import requests
API_KEY = 'fb6HQ8SOQ5aNPEST98Wz7pptYgVX70FW'
API_SECRET = 'FxJTodF7dh_fqDpccBsO2SX1WF4UP8rd'

def face_analyze(API_key,API_secret,face_tokens,landmark=1,attributes=None,face_rectangle=None,beauty_score_min=0,beauty_score_max=100):
    """该函数为调用face++ face_analyze接口"""
    analyze_url = 'https://api-cn.faceplusplus.com/facepp/v3/face/analyze'
    payload = {
            'api_key':API_KEY,
            'api_secret':API_SECRET,
            'face_tokens':face_tokens,
            'return_landmark':landmark,
            'return_attributes':attributes,
            'beauty_score_min':beauty_score_min,
            'beauty_score_max':beauty_score_max  
            }
    

r = requests.post(base_url, params = payload)
return r.json()